-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some doc examples to lib{green,native} #12073
Conversation
//! let config = PoolConfig::new(); | ||
//! let mut pool = SchedPool::new(config); | ||
//! | ||
//! // Spawn tasks into the pool of schedulers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice if the relationship between threads, schedulers, tasks, etc were outlined here. I still don't know what they are on libgreen. Additionally, what parallelism one can expect when using libgreen.
cool examples |
green::start(argc, argv, proc() { | ||
main(); | ||
}) | ||
green::start(argc, argv, main) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does coercion bare fn -> proc work? I thought that may've disappeared in @eddyb's env-ptr removal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's gone for function pointers -> closures or procs but not statically known functions. Too lazy to check at the moment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does indeed, I've been using it regularly
fn start(argc: int, argv: **u8) -> int { green::start(argc, argv, main) }
That code is under 80 characters, which is the best part!
"How do I start in libX" is a common question that I've seen, so I figured putting the examples in as many places as possible is probably a good idea.
r? @cmr, I've added more documentation about the high-level design of libgreen, but I wouldn't exactly consider myself a stellar author. |
"How do I start in libX" is a common question that I've seen, so I figured putting the examples in as many places as possible is probably a good idea.
fix: fn_param completion lookup close rust-lang#12073 caused by rust-lang#12040
"How do I start in libX" is a common question that I've seen, so I figured
putting the examples in as many places as possible is probably a good idea.